package com.mysql.mapper;

import com.mysql.pojo.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

public interface UserMapper {
    //查询
    List<User> selectList();

    @Select("select * from user")
    List<User> getUserList();
    //分页查询
    List<User> selectLimit(Map<String,Integer> map);

    //分页查询2
    List<User> getUserByRowBounds();

    //匹配查询
    List<User> selectLike(String value);


    //增加
    void saveUser(User user);
    //删除
    void delUser(int id);
    //注解删除
    @Delete("delete from user where #{id}")
    int deleteUserById(@Param("id") int id);
    //修改
    void updateUser(User user);
}
